#!/bin/bash  

function my_function {  
	echo "This script is called: $BASH_SOURCE[0]"
    echo "This function was called from: ${BASH_SOURCE[1]}"  
}  

my_function

SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}")"&> /dev/null && pwd )"
echo "Script directory is: $SCRIPT_DIR"

